package top.xcxdl.rural.service.impl;

import top.xcxdl.rural.entity.RuralResource;
import top.xcxdl.rural.mapper.RuralResourceMapper;
import top.xcxdl.rural.service.IRuralResourceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Ding
 * @since 2022-05-05
 */
@Service
public class RuralResourceServiceImpl extends ServiceImpl<RuralResourceMapper, RuralResource> implements IRuralResourceService {

    @Override
    public int toAddItem(RuralResource ruralResource) {
        ruralResource.setCreateTime(String.valueOf(System.currentTimeMillis() / 1000));
        ruralResource.setUpdateTime(String.valueOf(System.currentTimeMillis() / 1000));
        return baseMapper.insert(ruralResource);
    }
}
